SERVICE_NAME = payv2api
SERVICE_CNAME = 支付V2
MYSQL_USER = qiyunxin
MYSQL_PASSWORD = 123456
MYSQL_DATABASE = sampledb
MYSQL_SERVICE_NAME = mysql$(SERVICE_NAME)
build:
	oc project databases
	oc create -f pv_rbd_mysql.yaml
	oc process mysql-persistent -v DATABASE_SERVICE_NAME=$(MYSQL_SERVICE_NAME) MYSQL_USER=$(MYSQL_USER) MYSQL_PASSWORD=$(MYSQL_PASSWORD) MYSQL_DATABASE=$(MYSQL_DATABASE) | oc create -f -
	oc project qiyunxin
	oc create -f pv_hfs.yaml
	oc create -f list.yaml
prepare: 
	mkdir -p /data/config/$(SERVICE_NAME)/
	chmod -R 777 /data/config/$(SERVICE_NAME)/
	cp -rf config/* /data/config/$(SERVICE_NAME)/	
uninstall:
	oc project databases
	oc delete -f pv_rbd_mysql.yaml
	oc delete pvc/$(MYSQL_SERVICE_NAME)
	oc delete dc/$(MYSQL_SERVICE_NAME)
	oc delete svc/$(MYSQL_SERVICE_NAME)
	oc project qiyunxin
	oc delete -f pv_hfs.yaml
	oc delete -f list.yaml